package homework02;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class CollectionsTest {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Collections.addAll(list, 20, 30, 40, 50, 60);
        System.out.println(list);
        //打乱顺序
        Collections.shuffle(list);
        System.out.println(list);
        //升序排序
        list.sort((o1, o2) -> o1 - o2);
        System.out.println(list);
        //降序排序
        list.sort(((o1, o2) -> o2 - o1));
        System.out.println(list);
    }

}
